home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / usr / share / pyshared / DistUpgrade / DistUpgradeFetcherSelf.py < prev    next >
Text File  |  2009-11-02  |  1KB  |  31 lines

  1. import logging
  2. import shutil
  3.  
  4. from DistUpgradeFetcherCore import DistUpgradeFetcherCore
  5.  
  6. class DistUpgradeFetcherSelf(DistUpgradeFetcherCore):
  7.     def __init__(self, new_dist, progress, options, view):
  8.         DistUpgradeFetcherCore.__init__(self,new_dist,progress)
  9.         self.view = view
  10.         # user chose to use the network, otherwise it would not be
  11.         # possible to download self
  12.         self.run_options += ["--with-network"]
  13.         # make sure to run self with proper options
  14.         if options.cdromPath is not None:
  15.             self.run_options += ["--cdrom=%s" % options.cdromPath]
  16.         if options.frontend is not None:
  17.             self.run_options += ["--frontend=%s" % options.frontend]
  18.  
  19.     def error(self, summary, message):
  20.         return self.view.error(summary, message)
  21.  
  22.     def runDistUpgrader(self):
  23.         " overwrite to ensure that the log is copied "
  24.         # copy log so it isn't overwritten
  25.         logging.info("runDistUpgrader() called, re-exec self")
  26.         logging.shutdown()
  27.         shutil.copy("/var/log/dist-upgrade/main.log",
  28.                     "/var/log/dist-upgrade/main_update_self.log")
  29.         # re-exec self
  30.         DistUpgradeFetcherCore.runDistUpgrader(self)
  31.